/*
 *  Copyright (C) 2010 Glauco
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package org.balisunrise.common.abstracts;

import java.util.List;
import org.balisunrise.annotation.FilterType;
import org.balisunrise.common.FieldComponent;

/**
 *
 * @author Glauco
 */
public abstract class AbstractCriterionableFieldLayout extends AbstractFieldLayout{

    protected FilterType filterType;
    protected boolean emptyForAll;
    public static final String PROP_FILTERTYPE = "filterType";
    public static final String PROP_EMPTYFORALL = "emptyForAll";

    /**
     * Get the value of emptyForAll
     *
     * @return the value of emptyForAll
     */
    public boolean isEmptyForAll() {
        return emptyForAll;
    }

    /**
     * Set the value of emptyForAll
     *
     * @param emptyForAll new value of emptyForAll
     */
    public void setEmptyForAll(boolean emptyForAll) {
        boolean oldEmptyForAll = this.emptyForAll;
        this.emptyForAll = emptyForAll;
        changeSupport.firePropertyChange(PROP_EMPTYFORALL,
                oldEmptyForAll, emptyForAll);
    }

    /**
     * Get the value of filterType
     *
     * @return the value of filterType
     */
    public FilterType getFilterType() {
        return filterType;
    }

    /**
     * Set the value of filterType
     *
     * @param filterType new value of filterType
     */
    public void setFilterType(FilterType filterType) {
        FilterType oldFilterType = this.filterType;
        this.filterType = filterType;
        changeSupport.firePropertyChange(PROP_FILTERTYPE,
                oldFilterType, filterType);
    }

    @Override
    public List<FieldComponent> getFields() {
        return super.getFields();
    }

}
